<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button class="add">添加</button>
    <button class="del">删除</button>
    <script>
        document.querySelector('.add').addEventListener('click', function() {
            const a = document.createElement('a')
            a.innerHTML = '🐓'
            a.href = 'https://www.baidu.com'
            document.body.appendChild(a)
        })
        document.querySelector('.del').addEventListener('click', function() {
            setInterval(() => {
                const a = document.querySelector('a')
                document.body.removeChild(a)
            }, 1000)
        })
    </script>
</body>

</html>